package cn.lijinlong.ljl666.controller;

import com.jfinal.core.Controller;
import com.jfinal.kit.Base64Kit;

import cn.lijinlong.ljl666.model.User;

public class LogininController extends Controller {
	private User user = new User();

	public void index() {
		this.render("login.html");
	}

	public void login() {
		user = this.user
				.findFirst("select * from `user` where ( `user` = '" + this.getPara("useroremail") + "' or `email` = '"
						+ this.getPara("useroremail") + "' ) and `password` = '" + Base64Kit.encode(this.getPara("password")) + "'");
		if (user != null) {
			this.redirect("/admin");
		}else {
			
		}
	}
}